#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>
int main()
{
	int a, b=0, max1=0, max2=0, n=0;
	double w;
	printf("score:");
	scanf("%d", &a);
	while (a >= 0)
	{
		if (a <= 100)
		{
			n++;
			b += a;
			if (a > max1)max1 = a;
			if (a<max1 && a>max2)max2 = a;
		}
		printf("score:");
		scanf("%d", &a);
	}
	if (n >= 2)
	{
		w = b / n * 1.0;
		printf("total=%d,average=%.2f\nfirst=%d,second=%d", n, w, max1, max2);
	}
	if (n == 1)
	{
		w = b / n * 1.0;
		printf("total=%d,average=%.2f\nfirst=%d", n, w, max1);
	}
	if (n == 0)
		printf("no valid scores");
	return 0;
}
